A typical computer system may include one or more microprocessors that execute code and operate on data stored within the computer system's memory and disk drives. To facilitate the fetching and storing of instructions and data, a microprocessor may include one or more levels of cache memory. Microprocessor cache memory may include, for example, a level one (L1) cache and a level two (L2) cache, and such cache memory may reside on-chip or off-chip. Frequently accessed data may be stored in the cache after an initial access of the data from the main memory, and subsequent accesses to the frequently accessed data may be made to the cache instead of to the main memory.
Types of cache memory include write-through cache and write-back cache. In computer systems using write-through cache, when the processor issues a command to write data to the main memory, the data is written both to the cache and to the main memory. In systems using write-back cache, data is generally only written to the main memory when data in the cache is being replaced with some other data (i.e., data is only written to the main memory during an eviction of a cache line). Write-back cache is generally faster than write-through cache because writing to the slower main memory is avoided on write operations in write-back cache. In write-back cache, a cache line is “dirty” if the data of the cache line has been updated by the computer system but the corresponding data of the main memory has not also been updated. A cache line is “clean” if the cache line has the same data as is stored the main memory.